﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EnheimGallery.DAL.SystemDAL;
using EnheimGallery.DAL.AccountManagementDAL;
using EnheimGallery.Models.NewsModel;

namespace EnheimGallery.Controllers
{
    public class NewsController : Controller
    {
        public ActionResult SystemMessages()
        {
            List<SystemMessageViewModel> viewModel = new List<SystemMessageViewModel>();
            List<SysMessageData> messagesData = SystemMessagesDAL.SystemMessagesInfo();

            foreach (var mes in messagesData)
            {
                viewModel.Add(new SystemMessageViewModel(mes));
            }
            return View(viewModel);
        }
        public ActionResult NewUsersMessages()
        {
            List<NewUserViewModel> viewModel = new List<NewUserViewModel>();
            List<NewUserData> usersData = AccountManagementDAL.NewUsersMessageInfo();
            foreach (var mes in usersData)
            {
                viewModel.Add(new NewUserViewModel(mes));
            }
            return View(viewModel);
        }

    }
}
